﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcMall.Core.Domains;
using MvcMall.Portal.Controllers.Users.ViewModels;

namespace MvcMall.Portal.Controllers.Users.Mappers
{
    public class UserMessageToModelMapper
    {
        public UserMessageModel MapFrom(UserMessage input)
        {
            var model = new UserMessageModel
                            {
                                Id = input.Id,
                                IsRead = input.IsRead,
                                Content = input.Content,
                                IsReceiveDelete = input.IsReceiveDelete,
                                IsSendDelete = input.IsSendDelete,
                                ReceiveUserName = input.ReceiveUser.UserName,
                                SendTime = input.SendTime,
                                SendUserName = input.SendUser.UserName
                            };
            return model;
        }
    }
}
